//
//  WKStatusButtomView.swift
//  WKWeibo
//
//  Created by 恋guang年 on 16/3/31.
//  Copyright © 2016年 恋guang年. All rights reserved.
//

import UIKit

class WKStatusButtomView: UIView {
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    override init(frame: CGRect) {
        super.init(frame: frame)
        prepareForUI()
    }
    ///  添加子控件并添加约束
    private func prepareForUI(){
        ///添加子控件
        addSubview(forwardButton)
        addSubview(supportButton)
        addSubview(commentButton)
        addSubview(separatorLine1)
        addSubview(separatorLine2)
        ///添加约束
        //forwardButton
        forwardButton.snp_makeConstraints { (make) -> Void in
            make.leading.top.bottom.equalTo(self)
        }
        //supportButton
        supportButton.snp_makeConstraints { (make) -> Void in
            make.leading.equalTo(forwardButton.snp_trailing)
            make.top.bottom.equalTo(self)
            
            make.width.equalTo(forwardButton)
        }
        //commentButton
        commentButton.snp_makeConstraints { (make) -> Void in
            make.leading.equalTo(supportButton.snp_trailing)
            make.trailing.top.bottom.equalTo(self)
            
            make.width.equalTo(forwardButton)
        }
        //separatorLine1 separatorLine2
        separatorLine1.snp_makeConstraints { (make) -> Void in
            make.centerX.equalTo(forwardButton.snp_trailing)
            make.centerY.equalTo(forwardButton.snp_centerY)
        }
        separatorLine2.snp_makeConstraints { (make) -> Void in
            make.centerX.equalTo(supportButton.snp_trailing)
            make.centerY.equalTo(supportButton.snp_centerY)
        }
    }
    //MARK: - 懒加载
    private lazy var forwardButton:UIButton = UIButton(imgeName: "timeline_icon_retweet", bgImageName: "timeline_card_bottom_background", title: "转发")
    
    private lazy var supportButton:UIButton = UIButton(imgeName: "timeline_icon_unlike", bgImageName: "timeline_card_bottom_background", title: "赞")
    
    private lazy var commentButton:UIButton = UIButton(imgeName: "timeline_icon_comment", bgImageName: "timeline_card_bottom_background", title: "评论")
    
    private lazy var separatorLine1:UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line"))
    private lazy var separatorLine2:UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line"))


}












